printf( "Usage:\n %s [<events_bbs> [<tunes_bbs>]]\n\n<events_bbs> is the name of the events file for Maximus\n(optional, defaults to EVENTS00.BBS).\n\n<tunes_bbs> is the name of the Maximus \"tunes\" file\n(optional, defaults to TUNES.BBS).\n",prog);
exit(0);
}
void GetTunes(void) {
FILE *fp;
char line[MAXLLEN];
char *ptr;
if( NULL == (fp = fopen( tunes_bbs, "r" )) ) {
printf( "Error: tunes file \"%s\" not found\n\n", tunes_bbs );
HelpMe();
}
printf( "Getting tunes from \"%s\"...", tunes_bbs );
fflush(stdout);
num_tunes = 0;
while(fgets(line,MAXLLEN,fp) != NULL) {
ptr = line + strspn(line,whitespace);
if( strnicmp( ptr, "* YELL", 6 ) == 0 )
tune_nums[num_tunes++] = atoi( ptr + 6 );
}
fclose( fp );
if( num_tunes == 0 ) {
printf( "\nError: No tunes found in \"%s\"\n\n", tunes_bbs );
HelpMe();
}
printf( "\n" );
}
void WriteNewTune(void) {
FILE *in, *out;
char tmpname[NLEN];
char line[MAXLLEN], *p;
char *ptr;
tmpnam( tmpname );
if( NULL == (in = fopen( events_bbs, "r" )) ) {
printf( "Error: events file \"%s\" not found\n", events_bbs );
HelpMe();
}
if( NULL == (out = fopen( tmpname, "w" )) ) {
printf( "Error: unable to create temporary file \"%s\"\n", tmpname );